package com.geline.web.annotation;

import com.geline.web.handler.ValidBeforeHandler;

import java.lang.annotation.*;

/**
 * 方法前置检验注解
 * @ValidBefore(handler = ValidBeforeHandler1.class, idVariable = "id", errorMsg="您的密级不够！")
 * @ValidBefore(handler = ValidBeforeHandler2.class, idVariable = "submitVO.id", errorMsg="您的密级不够！")
 * @ValidBefore(handler = ValidBeforeHandler3.class, idVariable = null, errorMsg="您的密级不够！")
 *
 * @author: mx
 * @date: 2024-07-16 10:04
 */
@Repeatable(ValidBefores.class)
@Target({ ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ValidBefore {

    //id参数名：如果是对象用 submitVO.id
    String idVariable() default "id";

    //查询目标对象的密级
    Class<? extends ValidBeforeHandler> handler();

    //提示
    String errorMsg() default "@ValidBefore error !";
}
